/*******************************************************************************
 * $Header: /cvsroot/oloa/org.gocom.bpm.platform.model/src/org/gocom/bpm/platform/model/web/ProcessObjectFactory.java,v 1.1 2011/07/03 02:30:49 hufulai Exp $
 * $Revision: 1.1 $
 * $Date: 2011/07/03 02:30:49 $
 *
 *==============================================================================
 *
 * Copyright (c) 2001-2006 Primeton Technologies, Ltd.
 * All rights reserved.
 * 
 * Created on 2010-5-26
 *******************************************************************************/


package com.atozsoft.wf.web;

import com.eos.system.exception.EOSRuntimeException;
import com.eos.system.utility.ClassUtil;

public class ProcessObjectFactory {
	
	public static IProcessObjectProvider getProcessObjectProvider(String providerClassName){
		if(providerClassName==null)
			return new DefaultProcessObjectProvider();
		else{ 
			Object instance=null;
			try {
				instance = ClassUtil.newInstance(providerClassName, new Object[]{});
			} catch (Exception e) {
				e.printStackTrace();
			}
			
			if(instance instanceof IProcessObjectProvider)
				return (IProcessObjectProvider)instance;
			else
				throw new EOSRuntimeException(providerClassName+" is not IProcessObjectProvider Instance Object!");
		}
	}

}
